//
//  ZHFAttraction.m
//  GoTraveling
//
//  Created by dllo on 15/12/23.
//  Copyright © 2015年 开发华佗. All rights reserved.
//

#import "ZHFAttraction.h"

#import "ZHFTrip.h"

@implementation ZHFAttraction

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.tripArray = [NSMutableArray array];
    }
    return self;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
    if ([key isEqualToString:@"description"]) {
        
        self.descriptions = value;
    }
    if ([key isEqualToString:@"attraction_trip_tags"]) {
        
        NSArray *array = [[value firstObject] objectForKey:@"attraction_contents"];
        for (NSDictionary *dic in array) {
            
            ZHFTrip *trip = [[ZHFTrip alloc] init];
            [trip setValuesForKeysWithDictionary:dic];
            [self.tripArray addObject:trip];
        }
    }
}


@end
